/*******************************************************************************
 * Copyright (c) 2022 BestSolution.at and others.
 *  
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v.2.0 which is available at
 * https://www.eclipse.org/legal/epl-2.0.
 *  
 * SPDX-License-Identifier: EPL-2.0
 *  
 * Contributors:
 *     BestSolution.at - initial API and implementation
 *******************************************************************************/
/*
 * generated by Xtext
 */
package org.eclipse.fx.ide.gmodel.serializer;

import com.google.inject.Inject;
import java.util.Set;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.fx.ide.gmodel.gModelDSL.GDefault;
import org.eclipse.fx.ide.gmodel.gModelDSL.GDomainElement;
import org.eclipse.fx.ide.gmodel.gModelDSL.GDomainMap;
import org.eclipse.fx.ide.gmodel.gModelDSL.GDomainProperty;
import org.eclipse.fx.ide.gmodel.gModelDSL.GModel;
import org.eclipse.fx.ide.gmodel.gModelDSL.GModelDSLPackage;
import org.eclipse.fx.ide.gmodel.services.GModelDSLGrammarAccess;
import org.eclipse.xtext.Action;
import org.eclipse.xtext.Parameter;
import org.eclipse.xtext.ParserRule;
import org.eclipse.xtext.serializer.ISerializationContext;
import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer;

@SuppressWarnings("all")
public class GModelDSLSemanticSequencer extends AbstractDelegatingSemanticSequencer {

	@Inject
	private GModelDSLGrammarAccess grammarAccess;
	
	@Override
	public void sequence(ISerializationContext context, EObject semanticObject) {
		EPackage epackage = semanticObject.eClass().getEPackage();
		ParserRule rule = context.getParserRule();
		Action action = context.getAssignedAction();
		Set<Parameter> parameters = context.getEnabledBooleanParameters();
		if (epackage == GModelDSLPackage.eINSTANCE)
			switch (semanticObject.eClass().getClassifierID()) {
			case GModelDSLPackage.GDEFAULT:
				sequence_GDefault(context, (GDefault) semanticObject); 
				return; 
			case GModelDSLPackage.GDOMAIN_ELEMENT:
				sequence_GDomainElement(context, (GDomainElement) semanticObject); 
				return; 
			case GModelDSLPackage.GDOMAIN_MAP:
				sequence_GDomainMap(context, (GDomainMap) semanticObject); 
				return; 
			case GModelDSLPackage.GDOMAIN_PROPERTY:
				sequence_GDomainProperty(context, (GDomainProperty) semanticObject); 
				return; 
			case GModelDSLPackage.GMODEL:
				sequence_GModel(context, (GModel) semanticObject); 
				return; 
			}
		if (errorAcceptor != null)
			errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
	}
	
	/**
	 * Contexts:
	 *     GDefault returns GDefault
	 *
	 * Constraint:
	 *     (stringVal=STRING | intVal=INT)
	 */
	protected void sequence_GDefault(ISerializationContext context, GDefault semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Contexts:
	 *     GDomainElement returns GDomainElement
	 *
	 * Constraint:
	 *     (name=ID (superTypeList+=[GDomainElement|ID] superTypeList+=[GDomainElement|ID]*)? (map=GDomainMap | propertyList+=GDomainProperty+)?)
	 */
	protected void sequence_GDomainElement(ISerializationContext context, GDomainElement semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Contexts:
	 *     GDomainMap returns GDomainMap
	 *
	 * Constraint:
	 *     (builtIn='Int' | builtIn='Double' | builtIn='String' | builtIn='Boolean' | ref=[GDomainElement|ID])
	 */
	protected void sequence_GDomainMap(ISerializationContext context, GDomainMap semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Contexts:
	 *     GDomainProperty returns GDomainProperty
	 *
	 * Constraint:
	 *     (
	 *         ((builtIn='Int' | builtIn='Double' | builtIn='String' | builtIn='Boolean') list?='[]'? name=ID defaultValue=GDefault?) | 
	 *         (ref=[GDomainElement|ID] list?='[]'? name=ID)
	 *     )
	 */
	protected void sequence_GDomainProperty(ISerializationContext context, GDomainProperty semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Contexts:
	 *     GModel returns GModel
	 *
	 * Constraint:
	 *     (name=QualifiedName typeList+=GDomainElement+)
	 */
	protected void sequence_GModel(ISerializationContext context, GModel semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
}
